'''
Created on 2012-10-23

@author: infear
'''
def lines(_file):
    for line in _file:
        yield line
    yield '\n'
    
def block(_file):
    block=[]
    for line in lines(_file):
        if line.strip():
            block.append(line)
        else:
            yield ''.join(block)
            block=[]
